import React from 'react';
import ModalForm from '../../../components/modalForm';
import { requiredRule, numberRule, minRule } from '../../../utils';

export default function Editor(props) {
    const { isNew } = props;
    let config = {};
    if (!isNew) {
        config.id = {
            label: 'ID',
            input: {
                disabled: true,
            },
        };
    }
    config = {
        ...config,
        val2: {
            label: '充值标准值(元)',
            type: 'number',
            fd: {
                rules: [requiredRule, numberRule, minRule(1)],
            },
        },
        val1: {
            label: '赠值(元)',
            type: 'number',
            fd: {
                rules: [requiredRule, numberRule, minRule()],
            },
        },
        status: {
            label: '状态',
            type: 'bool',
            fd: {
                initialValue: true,
            },
        },

    };

    return (
        <ModalForm
            {
                ...{
                    ...props,
                    config
                }
            }
        />
    );
}
